viewcontroller den rootviewcontroller dönüş nasıl yapılır?
Buton ile son viewcontroller sayfasından rootviewcontroller sayfasına dönüş yapmak istiyorum.Burada NSArray ı nasıl kullanmalıyım
Teşekkürler.
[code]
NSString *starttEkle=[[NSBundle mainBundle] pathForResource:@"startt" ofType:@"png"];
UIImage *starttEkle1=[[UIImage alloc] initWithContentsOfFile:starttEkle];
UIButton *starttButton=[UIButton buttonWithType:UIButtonTypeCustom];
starttButton.frame=CGRectMake(100, 300, 120, 50);
[starttButton setImage:starttEkle1 forState:UIControlStateNormal];
[starttButton addTarget:self action:@selector(starttButton) forControlEvents:UIControlEventTouchUpInside];
[self .view addSubview:starttButton];
self.view.backgroundColor=[UIColor colorWithRed:1.000 green:0.584 blue:0.000 alpha:1.000];
[super viewDidLoad];
}
-(IBAction)UIButton:starttButton;
{
UINavigationController *animalend=self.navigationController;
[animalend popToRootViewControllerAnimated:NO];
[animalend pushViewController:animalend animated:YES];
/*
animal20ViewController *aniView20=[[animal20ViewController alloc]init];
NSMutableArray *animal=[NSArray arrayWithArray:self.navigationController.modalViewController];
[animal insertObject:aniView20 atIndex:[animal count]-19];
[self.navigationController setViewControllers:animal animated:NO];
[self.navigationController popViewControllerAnimated:YES];
*/
// mainpageViewController *animal=[[mainpageViewController alloc] initWithNibName:@"mainpageViewController" bundle:Nil];
//[self.navigationController pop];
}
[/code]